﻿Namespace PL.TSMSDK
    Public Class EmployeeProduct_PL
        Inherits PLBase

        Public Sub New(ByVal queryName As String)
            MyBase.New(queryName)
        End Sub
        Public Sub New()
            MyBase.New()
        End Sub

        Public Sub OnRowUpdating(ByVal sender As Object, ByVal e As SqlRowUpdatingEventArgs) Handles MetaDataTable.OnRowUpdating
        End Sub

        Public Overrides Function Delete() As Boolean
            'Throw New NotImplementedException("Delete To Come...")
            Return False
        End Function

        Public Overrides Function Validate() As Boolean
            'Throw New NotImplementedException("Validate To Come...")
            Return True
        End Function

        Public Shared Function GetEmployeeProduct(ByVal employeeID As Guid, ByVal productID As Guid) As DataRow
            Dim aRow As DataRow = Nothing
            Using mq As MetaQuery = MetaQuery.GetMetaQueryByName("EmployeeProduct")
                mq.SQLWhere = String.Format("EmployeeID_FK = '{0}' AND ProductID_FK = '{1}'", employeeID.ToString(), productID.ToString())
                mq.FillResultQuery()
                If mq.ResultQuery.Rows.Count > 0 Then
                    aRow = mq.ResultQuery.Rows(0)
                End If
            End Using
            Return aRow
        End Function
    End Class
End Namespace
